package v1

import (
	"devops-super/api"
	"devops-super/internal/model/entity"
	"devops-super/internal/model/mymodel"
	"github.com/gogf/gf/v2/frame/g"
)

// AlertSceneGetPageLstReq 获取告警场景分页列表请求
type AlertSceneGetPageLstReq struct {
	g.Meta `method:"get" path:"/alert-scene/page-list" summary:"分页获取告警场景列表" tags:"告警场景"`
	*api.PageLstReq
	Name      string   `json:"name" description:"名称"`
	Type      string   `json:"type" description:"类别标识"`
	DeptId    string   `json:"deptId" description:"所属部门"`
	TimeRange []string `json:"timeRange"` // 时间范围[开始,结束]
}

// AlertSceneGetPageLstRes 获取告警场景列表响应
type AlertSceneGetPageLstRes struct {
	*api.PageLstRes[*mymodel.AlertSceneResponse] // 告警场景响应结构体
}

// AlertSceneAddReq 新增告警场景请求
type AlertSceneAddReq struct {
	g.Meta `method:"post" path:"/alert-scene" summary:"新增告警场景" tags:"告警场景"`
	*mymodel.AlertScene
}

// AlertSceneAddRes 新增告警场景响应
type AlertSceneAddRes struct{}

// AlertSceneUptReq 更新告警场景请求
type AlertSceneUptReq struct {
	g.Meta `method:"put" path:"/alert-scene/{id}" summary:"更新告警场景" tags:"告警场景"`
	Id     uint64 `v:"min:1#告警场景ID必须" path:"id"`
	*mymodel.AlertScene
}

// AlertSceneUptRes 更新告警场景响应
type AlertSceneUptRes struct{}

// AlertSceneUptStatusReq 更新告警场景状态请求
type AlertSceneUptStatusReq struct {
	g.Meta `method:"patch" path:"/alert-scene/{id}/status" summary:"更新告警场景状态" tags:"告警场景"`
	Id     uint64 `v:"min:1#告警场景ID必须" path:"id"`
	Status int    `v:"required" json:"status"`
}

// AlertSceneUptStatusRes 更新告警场景状态响应
type AlertSceneUptStatusRes struct{}

// AlertSceneDelReq 删除告警场景请求
type AlertSceneDelReq struct {
	g.Meta `method:"delete" path:"/alert-scene/{id}" summary:"删除告警场景" tags:"告警场景"`
	Id     uint64 `v:"min:1#告警场景ID必须" path:"id"`
}

// AlertSceneDelRes 删除告警场景响应
type AlertSceneDelRes struct{}

// AlertSceneGetOneReq 获取单个告警场景请求
type AlertSceneGetOneReq struct {
	g.Meta `method:"get" path:"/alert-scene/getOne" summary:"获取单个告警场景" tags:"告警场景"`
	Id     uint64 `v:"min:1#告警场景ID必须" json:"id"`
}

// AlertSceneGetOneRes 获取单个告警场景响应
type AlertSceneGetOneRes struct {
	Info *entity.AlertScene `json:"info"`
}

// AlertSceneGetOptionsReq 获取告警场景选项请求
type AlertSceneGetOptionsReq struct {
	g.Meta     `method:"get" path:"/alert-scene/getOptions" summary:"获取告警场景选项" tags:"告警场景"`
	FieldKey   string `json:"fieldKey"`   //明确指出key的字段
	FieldLabel string `json:"fieldLabel"` //明确指出label的字段
	DeptId     int64  `json:"deptId"`
}

// AlertSceneGetOptionsRes 获取告警场景选项响应
type AlertSceneGetOptionsRes struct {
	Options []*api.FormOptionsItem `json:"options"`
}
